package com.choco.jsondb.editor;

import com.choco.jsondb.Context;
import com.choco.jsondb.JSONDB;

public interface Editor {
    boolean put(String key, Object object);
    boolean put(String key, String jsonString);
    boolean put(Object object);
    boolean put(String jsonString);

    boolean commit();

    static Editor get(Context context) {
        if(context.getMode() == JSONDB.KV_MODE){
            return new KVEditor(context);
        }else{
            return new ArrayEditor(context);
        }
    }
}
